/**
 * Created by jiachneyu on 2018/4/20.
 */
const blog = require('./blog').find;

const blogList = async (page) => {
    let params = {}, query = {};
    if (page) {
        params = {
            limit: 20,
            skip: 10 * (page - 1)
        };
        query = {
            draft: 1
        }
    }
    return await blog(query, params);
}

module.exports = blogList;
